package vlt.el.util;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class Config {

	private static final Config _instance = null;
	Properties props = null;
	Properties config = null;
	
	public static Config getInstance() throws FileNotFoundException, IOException {
		if (_instance!=null){
			return _instance;
		}else{
			return new Config();
		}
	}
	
	public Config() throws FileNotFoundException, IOException {
		props = new Properties();
   		props.load(new FileInputStream("el-vlt.properties"));
	}
	
	public void reloadConfigProperties() throws FileNotFoundException, IOException{
		config = new Properties();
		config.load(new FileInputStream(props.getProperty("config.file")));
	}
	
	public String getConfigProperty(String key){
		return config.getProperty(key);
	}
}
